<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of milestone
 *
 * @author Eko Prasetyo<nir@nirleka.web.id>
 */
class milestone extends CI_Controller {

	function init($nama_proyek) {
		$this->load->helper('path');
		$root = "";
		$url  = "";
		$rootAlias;
		$opts = array();

		$nama_proyek = str_replace("-", "_", $nama_proyek);
		$view_proyek = str_replace("_", " ", $nama_proyek);

		if (strcmp($this->session->userdata('jabatan'), "Sekretaris")== 0)
		{

			$root = set_realpath("project/".$nama_proyek."/client");
			$url = site_url('project').'/'.$nama_proyek."/client/";
			$rootAlias = $view_proyek."/client";
		}
		else if (strcmp($this->session->userdata('jabatan'), "Divisi interior")== 0)
		{
			$root = set_realpath("project/".$nama_proyek."/interior");
			$url = site_url('project').'/'.$nama_proyek."/interior/";
			$rootAlias = $view_proyek."/interior";
		}
		else if (strcmp($this->session->userdata('jabatan'), "Divisi arsitektur")== 0)
		{
			$root = set_realpath("project/".$nama_proyek."/arsitektur");
			$url = site_url('project').'/'.$nama_proyek."/arsitektur/";
			$rootAlias = $view_proyek."/arsitektur";
		}
		else if (strcmp($this->session->userdata('jabatan'), "Divisi estetika")== 0)
		{
			$root = set_realpath("project/".$nama_proyek."/estetika");
			$url = site_url('project').'/'.$nama_proyek."/estetika/";
			$rootAlias = $view_proyek."/estetika";
		}
		else if (strcmp($this->session->userdata('jabatan'), "Drafter operator")== 0)
		{
			$root = set_realpath("project/".$nama_proyek."/draft");
			$url = site_url('project').'/'.$nama_proyek."/draft/";
			$rootAlias = $view_proyek."/draft";
		}
		else
		{
			$root = set_realpath("project/".$nama_proyek);
			$url = site_url('project').'/'.$nama_proyek.'/';
			$rootAlias = $view_proyek;
		}

		$opts['root'] = $root;
		$opts['URL'] = $url;
		$opts['rootAlias'] = $rootAlias;
		$opts['dirSize'] = true;
		$opts['imgLib'] = 'gd';       // image manipulation library (imagick, mogrify, gd)
		$opts['tmbDir']       = '.tmb';       // directory name for image thumbnails. Set to "" to avoid thumbnails generation
		$opts['tmbCleanProb'] = 10;            // how frequiently clean thumbnails dir (0 - never, 100 - every init request)
		$opts['tmbAtOnce']    = 5;            // number of thumbnails to generate per request
		$opts['tmbSize']      = 48;           // images thumbnails size (px)
		$opts['fileURL']      = true;         // display file URL in "get info"

	//'uploadAllow'   => array('images/*'),
	//'uploadDeny'    => array('all'),
	//'uploadOrder'   => 'deny,allow'
	// 'disabled'     => array(),      // list of not allowed commands
	// 'dotFiles'     => false,        // display dot files
	// 'dirSize'      => true,         // count total directories sizes
	// 'fileMode'     => 0666,         // new files mode
	// 'dirMode'      => 0777,         // new folders mode
	// 'mimeDetect'   => 'internal',       // files mimetypes detection method (finfo, mime_content_type, linux (file -ib), bsd (file -Ib), internal (by extensions))
	// 'uploadAllow'  => array(),      // mimetypes which allowed to upload
	// 'uploadDeny'   => array(),      // mimetypes which not allowed to upload
	// 'uploadOrder'  => 'deny,allow', // order to proccess uploadAllow and uploadAllow options
	// 'imgLib'       => 'mogrify',       // image manipulation library (imagick, mogrify, gd)
	// 'tmbDir'       => '.tmb',       // directory name for image thumbnails. Set to "" to avoid thumbnails generation
	// 'tmbCleanProb' => 1,            // how frequiently clean thumbnails dir (0 - never, 100 - every init request)
	// 'tmbAtOnce'    => 5,            // number of thumbnails to generate per request
	// 'tmbSize'      => 48,           // images thumbnails size (px)
	// 'fileURL'      => true,         // display file URL in "get info"
	// 'dateFormat'   => 'j M Y H:i',  // file modification date format
	// 'logger'       => null,         // object logger
	// 'defaults'     => array(        // default permisions
	// 	'read'   => true,
	// 	'write'  => true,
	// 	'rm'     => true
	// 	),
	// 'perms'        => array(),      // individual folders/files permisions
	// 'debug'        => true,         // send debug to client
	// 'archiveMimes' => array(),      // allowed archive's mimetypes to create. Leave empty for all available types.
	// 'archivers'    => array()       // info about archivers to use. See example below. Leave empty for auto detect
	// 'archivers' => array(
	// 	'create' => array(
	// 		'application/x-gzip' => array(
	// 			'cmd' => 'tar',
	// 			'argc' => '-czf',
	// 			'ext'  => 'tar.gz'
	// 			)
	// 		),
	// 	'extract' => array(
	// 		'application/x-gzip' => array(
	// 			'cmd'  => 'tar',
	// 			'argc' => '-xzf',
	// 			'ext'  => 'tar.gz'
	// 			),
	// 		'application/x-bzip2' => array(
	// 			'cmd'  => 'tar',
	// 			'argc' => '-xjf',
	// 			'ext'  => 'tar.bz'
	// 			)
	// 		)
	// 	)
		$this->load->library('Elfinder_lib', $opts);
	}

}

//end of file